package com.ruoyi.gateway.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gateway.mapper.DeviceConnectionStatusMapper;
import com.ruoyi.gateway.domain.DeviceConnectionStatus;
import com.ruoyi.gateway.service.IDeviceConnectionStatusService;

/**
 * 设备连接状态Service业务层处理
 *
 * @author 白向阳
 * @date 2025-09-28
 */
@Service
public class DeviceConnectionStatusServiceImpl implements IDeviceConnectionStatusService
{
    @Autowired
    private DeviceConnectionStatusMapper deviceConnectionStatusMapper;

    /**
     * 查询设备连接状态
     *
     * @param id 设备连接状态主键
     * @return 设备连接状态
     */
    @Override
    public DeviceConnectionStatus selectDeviceConnectionStatusById(Long id)
    {
        return deviceConnectionStatusMapper.selectDeviceConnectionStatusById(id);
    }

    /**
     * 查询设备连接状态列表
     *
     * @param deviceConnectionStatus 设备连接状态
     * @return 设备连接状态
     */
    @Override
    public List<DeviceConnectionStatus> selectDeviceConnectionStatusList(DeviceConnectionStatus deviceConnectionStatus)
    {
        return deviceConnectionStatusMapper.selectDeviceConnectionStatusList(deviceConnectionStatus);
    }

    /**
     * 新增设备连接状态
     *
     * @param deviceConnectionStatus 设备连接状态
     * @return 结果
     */
    @Override
    public int insertDeviceConnectionStatus(DeviceConnectionStatus deviceConnectionStatus)
    {
        deviceConnectionStatus.setCreateTime(DateUtils.getNowDate());
        return deviceConnectionStatusMapper.insertDeviceConnectionStatus(deviceConnectionStatus);
    }

    /**
     * 修改设备连接状态
     *
     * @param deviceConnectionStatus 设备连接状态
     * @return 结果
     */
    @Override
    public int updateDeviceConnectionStatus(DeviceConnectionStatus deviceConnectionStatus)
    {
        deviceConnectionStatus.setUpdateTime(DateUtils.getNowDate());
        return deviceConnectionStatusMapper.updateDeviceConnectionStatus(deviceConnectionStatus);
    }

    /**
     * 批量删除设备连接状态
     *
     * @param ids 需要删除的设备连接状态主键
     * @return 结果
     */
    @Override
    public int deleteDeviceConnectionStatusByIds(Long[] ids)
    {
        return deviceConnectionStatusMapper.deleteDeviceConnectionStatusByIds(ids);
    }

    /**
     * 删除设备连接状态信息
     *
     * @param id 设备连接状态主键
     * @return 结果
     */
    @Override
    public int deleteDeviceConnectionStatusById(Long id)
    {
        return deviceConnectionStatusMapper.deleteDeviceConnectionStatusById(id);
    }
}
